package com.cy;
//懒汉式
public class Test16 {
    public static void main(String[] args) {

        Student a = Student.get();
        Student b = Student.get();
        System.out.println(a==b);

    }
}

class Student{
    private Student(){}
    static private Student s;

    synchronized static public Student get(){
        if(s==null){
            s=new Student();
        }
        return s;
    }
}